import request from '@/utils/request'


export function updateGroupUserRole(uid,gid,rid){
  return request({
    url:'/update/group/user/'+uid+'/'+gid+'/'+rid,
    method:'put'
  })
}

export function getRoleList(){
  return request({
    url:'/get/all/role/list',
    method:'get'
  })
}

export function deleteGroupUser(uid,gid){
  return request({
    url:'/delete/group/user/'+gid+'/'+uid,
    method:'delete'
  })
}

export  function  getGroupUser(gid){
  return request({
    url:'/get/group/users/'+gid,
    method:'get'
  })
}

export function addUserTogroup(gid,params){
  return request({
    url:'/update/group/users/'+gid,
    method:'put',
    data:params
  })
}



export function getGroupList(url) {
  return request({
    url: url,
    method: 'get'
  })
}
export function insertGroup(params) {
  return request({
    url: '/add/vo/group',
    method: 'post',
    data: params
  })
}
export function countGroup(params) {
  return request({
    url: '/get/group/statistics' + '?gname=' + params,
    method: 'get',
    data: params
  })
}
export function manageGroup(params){
  return request({
    url: '/get/users/in/and/not/in/group'+'?gname='+params,
    method: 'get',
    data:params
  })
}

export function searchGroup(params) {
  return request({
    url: '/get/group/like',
    method: 'post',
    data: params
  })
}

  export function deleteGroupByList(gids) {
    return request({
      url: 'del/groups/by/names',
      method: 'delete',
      data: gids
    })
  }
export function deleteGroupByGname(url) {
  return request({
    url: url,
    method: 'delete'
  })
}
